import jieba.analyse


lines = open(u"西游记.txt", 'rb').read()
print(" ".join(jieba.analyse.extract_tags(lines, topK=20, withWeight=True, allowPOS=())))